
<!DOCTYPE html>
<html>
<head>
	<title>var</title>
	<mete name="viewport" content="width=device-width, initial-scale=1"></meter>
     <script>
          let a = 10;
          let promise = new Promise(function(resolve, reject) {
               if (a == 10) {
                    resolve("success");
               } else {
                    reject("fail");
               }
          });
          //promise.then(success, fail);
          promise.then(
               res=>{
                    console.log(res);
               },
               err=>{
                  console.log("fail");  
               }
          );

          promise.catch(error=>{
               console.log(err);
          })
     </script>
</head>

<body>
</body>

</html>